A graphics processor unit is conventionally coupled to memory. This memory may be used as a frame buffer. This frame buffer is used to store image content, more particularly pixels after processing through a graphics pipeline of a graphics processor.
In graphics processing, commands are provided to a graphic pipeline from an operating system, an application or other computer program to display an image on a screen of a display device. In the graphics pipeline, a raster operations processor receives image content such as geometry, texture and pixel information, and rasterizes this image content for storage in memory for subsequent display.
Conventionally, raster operations involve horizontally scanning an image (e.g. a character in a font set) line-by-line in order to provide pixel information for storage in a frame buffer. Accordingly, by horizontally scanning on a line-by-line basis, an image may be rasterized for storing in a frame buffer. This frame buffer stores image content in the same orientation as it is written to the memory. In other words, a memory is an array of memory cells, and a row of memory cells is associated with a horizontal scan line from raster operations. Pixels are read from the frame buffer and sent to a display in raster line order (i.e., “scan out”). Thus, raster lines are provided as horizontal rows for going across a display. Image content is provided to a display on a line-by-line basis with scanned out horizontal rows.
By having commonality between raster operations, memory storage and display image generation with respect to scanned horizontal information, a problem emerges when orientation of a display or display mode is altered, such as from landscape orientation to portrait orientation as illustratively shown in FIG. 1A. This is in part due to how frame buffer memory is accessed for scan out. Frame buffer memory is accessed with block reads from memory to read out a plurality of pixels at a time. Graphics processors are optimized to take advantage of block transfers to and from memory, and make implicit assumptions that raster lines are horizontal. However, raster lines are not horizontal when a display normally in landscape mode is rotated to portrait mode or otherwise flipped or rotated. In FIG. 1A, document 3 is shown prior to display screen rotation from landscape mode to portrait mode. After display screen rotation 4A, a rotated document 3R is shown. However, horizontal lines of document 3R are not properly oriented. A proper orientation is shown in FIG. 1B, where document 3 is shown after rotation 4B as a rotated and aligned document 3R-A.
Others have provided a mapping table as an intermediate step between obtaining a rasterized image and writing it to memory. However, this not only consumes additional resources to take physically unrotated content and transpose it to physically rotated content, but it is further undesirable as it consumes memory bandwidth. Additional memory bandwidth can be consumed due to performing block reads of multiple pixels for scanout, but using only one of the read pixel values due to scanning out one raster line at a time.
Accordingly, it would be desirable and useful to provide rotation of image content in a manner, which has less impact on memory bandwidth. Furthermore, it would be desirable and useful to provide image rotation without consuming any additional memory bandwidth than in conventional graphics processing.